Skip to content

feat(notifications): add Slack edit notifications for Ocotillo CRUD#730

Merged
jeremyzilar merged 19 commits into
stagingfrom
BDMS-921-slack-edit-notifications
Jun 22, 2026
Merged

feat(notifications): add Slack edit notifications for Ocotillo CRUD#730
jeremyzilar merged 19 commits into
stagingfrom
BDMS-921-slack-edit-notifications

Conversation

@jeremyzilar

Copy link
Copy Markdown
Contributor

Summary

  • Adds services/edit_notification_helper.py with EditEvent, Block Kit payload building, and best-effort background Slack posts when SLACK_EDITS_WEBHOOK_URL is set
  • Wires notifications for asset uploads (new uploads only), project add/remove on wells, and generic CRUD via model_adder / model_patcher / model_deleter
  • Includes group thing association routes (POST/DELETE /group/{group_id}/things/{thing_id}) needed by the well edit panel
  • Adds deploy config for SLACK_EDITS_WEBHOOK_URL and OCOTILLO_UI_BASE_URL, plus unit and integration tests

Deploy notes

  • Create GCP Secret Manager secret slack-edits-webhook-url before staging/production deploy
  • Optional GitHub var OCOTILLO_UI_BASE_URL (workflows default to staging/production Ocotillo URLs)

Test plan

  • uv run pytest tests/test_edit_notification_helper.py tests/test_group.py tests/test_asset.py -q
  • With webhook set on staging, upload a file on a well detail page and confirm Slack message
  • Add/remove a project on a well via edit panel and confirm Slack messages
  • PATCH a contact and confirm generic update notification with field diffs
  • Duplicate asset upload does not post a second Slack message

jeremyzilar and others added 16 commits June 18, 2026 10:42
Supports the well edit panel in OcotilloUI (BDMS-879): POST and DELETE on /group/{group_id}/things/{thing_id} with 404/409 handling and audit on create.
EditEvent model, Block Kit payload builder, and best-effort background webhook post when SLACK_EDITS_WEBHOOK_URL is set.
@jeremyzilar jeremyzilar requested a review from jirhiker June 18, 2026 14:58
@jeremyzilar jeremyzilar self-assigned this Jun 18, 2026
@TylerAdamMartinez TylerAdamMartinez self-requested a review June 18, 2026 15:25

@jirhiker jirhiker left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix pr title

@jeremyzilar jeremyzilar changed the title BDMS-921: Slack notifications for Ocotillo edits feat(notifications): add Slack edit notifications for Ocotillo CRUD Jun 18, 2026
Combine PR #729 audit logging on group thing removal with BDMS-921 Slack
edit notifications for project add/remove.
Newer FastAPI puts routers in app.routes without a path attribute, so walk nested routes when checking for the admin mount.
@jeremyzilar jeremyzilar merged commit 3210684 into staging Jun 22, 2026
9 checks passed
@jeremyzilar jeremyzilar deleted the BDMS-921-slack-edit-notifications branch June 22, 2026 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants